﻿<UserControl
    x:Class="NavigationDemo.Views.SharedContent"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:NavigationDemo.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid x:Name="titlePanel" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="220"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                <AppBarButton Command="{Binding GoBackCommand}" 
                    VerticalAlignment="Top" Icon="Back" Label="Back" />
                <AppBarButton Command="{Binding GoForwardCommand}" 
                    VerticalAlignment="Top" Label="Forward" Icon="Forward" />
            </StackPanel>
            <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="{Binding Title, FallbackValue=Title}" Style="{StaticResource HeaderTextBlockStyle}"/>
        </Grid>

        <ItemsControl ItemsSource="{Binding History}" Grid.Row="1" Margin="30">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Top">
                        <TextBlock FontSize="30" Text="{Binding Index}" Width="150" Margin="0,0,30,0" />
                        <TextBlock FontSize="30" Text="{Binding Value}" />
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

    </Grid>
</UserControl>
